using System.Data;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Windows.Forms;
using DevExpress.XtraEditors;

namespace E4RPDevExpress9
{
    public partial class PrintPreviewXtraForm : XtraForm
    {
        #region Properties

        public CrystalReportViewer CrystalReportViewer { get { return crystalReportViewer; } }

        #endregion

        public PrintPreviewXtraForm()
        {
            InitializeComponent();
        }

        public void Setup(DataSet data, string reportFilePath)
        {
            var reportDocument = new ReportDocument();
            reportDocument.Load(reportFilePath);
            reportDocument.SetDataSource(data);
            crystalReportViewer.ReportSource = reportDocument;
        }


        public void Setup(ReportDocument reportDocument)
        {
            crystalReportViewer.ReportSource = reportDocument;
        }
    }
}